var fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", "/modules/footer/css/footer.css")
document.getElementsByTagName("head")[0].appendChild(fileref)



var footer = {
    links : {
        data : {},
        update : function (id) {
            var link_id = id.split("aaa");
            if (this.data[link_id[0]] == undefined) this.data[link_id[0]] = {};
            if (this.data[link_id[0]][link_id[1]] == undefined) this.data[link_id[0]][link_id[1]] = {};
          
            this.data[link_id[0]][link_id[1]]["text"] = $("#" + id + "aaatext").val();
            this.data[link_id[0]][link_id[1]]["url"] = $("#" + id + "aaaurl").val();
            $("#btn_save_links").show("slow");
        },
        save : function () {
            $.ajax ({
                async: false,
                data: this.data,
                url: "/modules/footer/save_links.php",
                success: function (result) {
                    alert(result);
                  
                }
            });
        }
        
    }
};
